home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / xlib / xlib06p2 / xbmtools.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-23  |  1.4 KB  |  56 lines

  1. /*-----------------------------------------------------------------------
  2. ;
  3. ; XPOINT - header file
  4. ;
  5. ;
  6. ;
  7. ; ****** XLIB - Mode X graphics library                ****************
  8. ; ******                                               ****************
  9. ; ****** Written By Themie Gouthas                     ****************
  10. ;
  11. ; Macros written by Mathew Mackenzie
  12. ;
  13. ; egg@dstos3.dsto.gov.au
  14. ; teg@bart.dsto.gov.au
  15. ;
  16. ;  Terminology & notes:
  17. ;         VRAM ==   Video RAM
  18. ;         SRAM ==   System RAM
  19. ;         X coordinates are in pixels unless explicitly stated
  20. ;
  21. ;-----------------------------------------------------------------------*/
  22.  
  23. #ifndef _XBMTOOLS_H_
  24. #define _XBMTOOLS_H_
  25.  
  26. #define BM_WIDTH_ERROR 1
  27.  
  28. #define LBMHeight(lbitmap) lbitmap[1]
  29. #define LBMWidth(lbitmap) lbitmap[0]
  30. #define PBMHeight(pbitmap) pbitmap[1]
  31. #define PBMWidth(pbitmap) (pbitmap[0]<<2)
  32. #define PBMByteWidth(pbitmap) pbitmap[0]
  33.  
  34. #define LBMPutPix(x,y,lbitmap,color)  \
  35.         lbitmap[2 + (x) + (y) * LBMWidth(lbitmap)] = color
  36.  
  37. #define LBMGetPix(x,y,lbitmap)  \
  38.         (lbitmap[2 + (x) + (y) * LBMWidth(lbitmap)])
  39.  
  40.  
  41.  
  42. /* FUNCTIONS =========================================================== */
  43.  
  44.  
  45. int x_pbm_to_bm(           /* Convert from planar bitmap to linear */
  46.   char * source_pbm,
  47.   char * dest_bm);
  48.  
  49. int x_bm_to_pbm(           /* Convert from linear bitmap to planar */
  50.   char * source_pbm,
  51.   char * dest_bm);
  52.  
  53. #endif
  54.  
  55.  
  56.